from rest_framework import serializers
from .models import Areas

class AreaInfoSerializer(serializers.ModelSerializer):

    class Meta:
        model = Areas
        fields = ['id','name']

class AreaSubInfoSerializer(serializers.ModelSerializer):

    subs = AreaInfoSerializer(many=True,read_only=True)

    class Meta:
        model = Areas
        fields = ['id','name','subs']
